﻿<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets  xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
    <CodeSnippet Format="1.0.0">
        <Header>
            <Description>属性匹配数据查询</Description>
            <Title>Rafy Query By CommonQueryCriteria</Title>
            <Shortcut>RafyQuery_Common</Shortcut>
            <Author>HuQingfang</Author>
            <SnippetTypes>
                <SnippetType>Expansion</SnippetType>
            </SnippetTypes>
        </Header>
        <Snippet>
            <Declarations>
                <Literal>
                    <ID>ReturnValue</ID>
                    <ToolTip>返回值</ToolTip>
                    <Default>EntityList</Default>
                </Literal>
                <Literal>
                    <ID>MethodName</ID>
                    <ToolTip>方法名</ToolTip>
                    <Default>GetBy</Default>
                </Literal>
                <Literal>
                    <ID>Parameters</ID>
                    <ToolTip>参数列表</ToolTip>
                    <Default>string parameter1, int parameter2</Default>
                </Literal>
                <Literal>
                    <ID>Property1</ID>
                    <ToolTip>匹配属性1</ToolTip>
                    <Default>Property1</Default>
                </Literal>
                <Literal>
                    <ID>InputParameters</ID>
                    <ToolTip>传入参数</ToolTip>
                    <Default>parameter1</Default>
                </Literal>
                <Literal>
                    <ID>EntityName</ID>
                    <ToolTip>实体类型</ToolTip>
                    <Default>Entity</Default>
                </Literal>
            </Declarations>
            <Code Language="csharp">
                <![CDATA[public $ReturnValue$ $MethodName$($Parameters$)
        {
            return this.GetBy(new CommonQueryCriteria
            {
                new PropertyMatch($EntityName$.$Property1$, $InputParameters$),
                //new PropertyMatch($EntityName$.Property2Property, PropertyMatchOperator.Equal, parameter2),$end$
            });
        }]]>
            </Code>
        </Snippet>
    </CodeSnippet>
</CodeSnippets>